<template>
	<el-dialog :visible.sync="visible" title="下级列表" width="800px" :before-close="close">
		<el-table :data="list" style="width: 100%" v-loading="loading">
			<el-table-column prop="name" label="下级名称" width="230">
			</el-table-column>
			<el-table-column prop="mobile" label="联系电话">
			</el-table-column>
			<el-table-column prop="sex" label="性别" width="180">
				<template slot-scope="{row}">
					<!-- 性别0保密1男2女 -->
					<el-tag v-if="row.sex == 0">保密</el-tag>
					<el-tag v-if="row.sex == 1" type="success">男</el-tag>
					<el-tag v-if="row.sex == 2" type="danger">女</el-tag>
				</template>
			</el-table-column>
			<!--  <el-table-column
		        prop="mobile"
		        label="家庭成员联系电话">
		      </el-table-column> -->
		</el-table>
	</el-dialog>
</template>

<script>
import { imghttp, get, post, del } from '@/assets/js/http'
export default {
	name: "member-lower",
	data() {
		return {
			visible: false,
			list: [],
			id: 0
		}
	},
	methods: {
		async getList() {
			this.loading = true
			let res = await post({
				url: '/admin/user.RealmeritUser/user_pid',
				data: {
					id: this.id
				}
			})
			this.list = res
			this.loading = false
		},
		open(id) {
			this.id = id
			this.visible = true
			this.getList()
		},
		close() {
			this.visible = false
		}
	}
};
</script>
